function form_keypress( Elem, IsKey, Button, sIdiom)
{
	if (document.forms[0].Mode.value == "UPD")
	{
		if (document.forms[0].IsConfirmed.value == "1")
		{
			if (IsKey)
			{
				Button.value = message_text( sIdiom, "captionadd");
			}
			else
			{
				Button.value = message_text( sIdiom, "captionupdate");
			}
			document.forms[0].IsConfirmed.value = "0";
		}
		else
		{
			if (IsKey)
			{
				Button.value = message_text( sIdiom, "captionadd");
			}
		}
	}
	else if (document.forms[0].Mode.value == "INS")
	{
		if (document.forms[0].IsConfirmed.value == "1")
		{
			Button.value = message_text( sIdiom, "captionadd");
			document.forms[0].IsConfirmed.value = "0";
		}
	}
}
